﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="../components/lib/bootstrap.min.css" />
<link rel="stylesheet" href="../components/lib/toastr.min.css" />
<link rel="stylesheet" href="../components/lib/style.css" />

<link rel="stylesheet" type="text/css" href="styles/style.css">
</head>

<body>

  <div id="loading"><img src="img/loading.gif"></div>

  <div id="main" style="display:none">

      <script class="controller" type="text/html">
          <div class="topTxt_red">
              <h3><%==voteInfo.title%></h3>
          </div>
          <div class="textBG_red">
              <div><h4><%==voteInfo.summary%></h4></div>
              <img class="img-responsive" width="100%" src="<%=voteInfo.contentImageUrl%>" />    
          </div>
          <h4 class="text-center top_txt_red">
              <%==voteInfo.contentDescription%>
          </h4>

          <%if (!isVoted){%>
          <div class="container">
              <div class="joozo_Mar7Px">
                  <%
                  for(i = 0; i < itemList.length; i ++) {
                  var item = itemList[i];
                  %>
                  <div class="col-xs-12 title_list itemID" itemID="<%=item.id%>" >
                      <%if (item.navigationUrl){%>
                      <h4><div class="J_t"><%=item.title%></div></h4>
                      <span class="J_m6"><a href="<%=item.navigationUrl%>">更多</a></span>
                      <%}else{%>
                      <h4><%=item.title%></h4>
                      <%}%>
                  </div>
                  <%}%>
              </div>
              
              <div class="joozo_Mar7Px">
                  <table>
                      <tr>
                          <td style="display:none">
                              <input type="checkbox" checked="checked" name="checkbox" id="Anonymous" onclick="ChoseVoteType(this)">
                              <label for="Anonymous">匿名投票</label>
                          </td>
                          <td>
                              <input type="checkbox" name="checkbox" id="RealName" onclick="ChoseVoteType(this)">
                              <label for="RealName">实名投票</label>
                          </td>
                      </tr>
                  </table>
              </div>
              <div id="VoteUserNameDiv" class="joozo_Mar7Px" style="margin-bottom:10px;display: none">
                  <label>姓名：</label>
                  <input type="text" id="userName" class="form-control" placeholder="请填写您的姓名" value="" required>
              </div>
              <div class="row joozo_Mar7Px">
                      <div class="marginBottom joozo_Pad0Px">
                          <button class="btn btn-block btn-danger btn-lg" type="button" onclick="controller.submitVote();return false;">确认提交</button>
                      </div>
                  </div>
              </div>
      <%}else{%>
        <div class="container">

          <h3>投票结果</h3>
          <hr />

          <%
          for(i = 0; i < itemList.length; i ++) {
            var item = itemList[i];
          %>
          <strong><%=item.title%></strong> <span>(<%=item.voteNum%>)</span>

          <div class="progress <%=isItem(item.id) ? 'progress-striped active' : ''%>">
              <div class="progress-bar progress-bar-danger" style="width: <%=getPercentage(item.voteNum);%>;"><%=getPercentage(item.voteNum);%></div>
          </div>
          <%}%>

        </div>
      <%}%>

      <%if (!isPoweredBy){%>
        <div class="footer">
          <p>技术支持：阁下 <a href="http://www.gexia.com" target="_blank">GEXIA.COM</a></p>
        </div>
      <%}else if(poweredBy){%>
        <div class="footer">
          <p><%==poweredBy%></p>
        </div>
      <%}%>

    </script>

  </div>

</body>
</html>

<script src="../components/lib/jquery-1.11.0.min.js"></script>
<script src="../components/lib/bootstrap.min.js"></script>
<script src="../components/lib/json2.js"></script>
<script src="../components/lib/template.js"></script>
<script src="../components/lib/toastr.min.js"></script>
<script src="../components/lib/notifyService.js"></script>
<script src="../components/lib/utilService.js"></script>

<script src="scripts/service.js"></script>
<script src="scripts/controller.js"></script>